<?php

namespace app\server;

use think\cache\driver\Redis;
use Workerman\Redis\Client;

class RedisClientSever
{
    private static $redis;

    private static $_instance;

    private function __construct()
    {}

    private function __clone()
    {

    }

    public static function getInstance()
    {
        if (! (self::$_instance instanceof self)) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }

    public function redisClientServer()
    {
        $redisInfo = config('cache.stores.redis');
        if (!self::$redis) {
            self::$redis = new Redis($redisInfo);
        }
        return self::$redis;
    }
}